/**
 * Block.h
 * This class defines the block's coordinate on the board, the block number, block location, and 
 * whether the block has been marked to disappear by the part of the code that looks for rows
 * that are filled up blocks. 
 * 
 * 
 * Revision History: 
 *
 * Date     Author       Version   Changes
 * ======== ============ ========= ================================================================
 * 05/08/09 PJ Cabrera   1.0       Initial version.
 * 03/06/10 Steve Hu     1.1	   Added variable "type" which represent specific block filename 
 *                                 to the class.
 * 03/12/10 Robin Mahony 1.2	   Added "zeroScale" for use with ensuring 0 blocks fall less 
 * 03/18/10 Robin Mahony 1.3	   Modified newBlock method to accept arguments (ie. the difficulty) 
 *							       
 *
 * ======== ============ ========= =================================================================
 *
 */

#import "cocos2d.h"

@interface Block : Sprite 
{
	int boardX, boardY;
	int BlockType;
	BOOL stuck;
	BOOL disappearing;
	NSString *type;
}

@property int boardX;
@property int boardY;
@property int BlockType;
@property BOOL stuck;
@property BOOL disappearing;
/* By using the retain property for the synthesized setter, we allow it to tell 
 the memory management system that there is at least one more object interested 
 in keeping the NSString* around.  */
@property (nonatomic, retain) NSString *type;

+ (Block *) newBlock:(int) lev;
- (void) moveUp;
- (void) moveDown;
- (void) moveLeft;
- (void) moveRight;

@end

/* Macros to define Block position on the screen based on board coordinates  */
#define COMPUTE_X(x) (abs(x) * 32)
#define COMPUTE_Y(y) abs(400 - (abs(y) * 32))
#define COMPUTE_X_Y(x,y) ccp( COMPUTE_X(x), COMPUTE_Y(y) )
